package io;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("fos.txt");
        BufferedOutputStream dos=new BufferedOutputStream(fos);
        String aa="刘思甜是个大笨猪";
        byte[] batt=aa.getBytes(StandardCharsets.UTF_8);
        dos.write(batt);
        System.out.println("写入完毕");
        dos.flush();

    }
}
